		Ext.onReady(function(){
			Ext.form.Field.prototype.msgTarget='side';
			Ext.util.CSS.swapStyleSheet('theme','ext/resources/css/xtheme-gray.css'); 
			Ext.QuickTips.init();  
			var bod = new Ext.form.DateField({
				fieldLabel:'Birth Day',
				name:'bod',
				format:'Y-m-d',
				allowBlank:false
			})
			var aaa = new Ext.data.SimpleStore({
					fields:['myid','displayText'],
					data:[
							['1','male'],
							['2','female']
						]
				})
				
			var sex = new Ext.data.JsonStore({
                autoLoad:true,
                url : "sex.action",
                root : "sex",
                fields : [{
                            name : 'id'
                        }, {
                            name : 'gender'
                        }]
            });
			var sexCombobox = new Ext.form.ComboBox({
				store:sex,
				width:100,
				fieldLabel:'sex',
				hiddenName:'sexId',
				allowBlank:false,
				mode:'local',
				editable:false,
				triggerAction:'all',
				valueField:'id',
				displayField:'gender'
			});
			
			var selectMenu;
			function btclc(button){
				selectMenu.hide();
				btf.setValue(button.text);
				hidCityId.setValue(button.id);
			}
			var hidCityId = new Ext.form.Hidden({
				name:'cityId'
			})
			var btf = new Ext.form.TriggerField({
				fieldLabel:'pls choice',
				name:'btvalue',
				width:100,
				allowBlank:false,
				onTriggerClick:function(){
					if(selectMenu == undefined)
					{
						selectMenu = new Ext.menu.Menu({});
						selectMenu.setWidth(80);
						selectMenu.setHeight(50);
						selectMenu.add(new Ext.Button({
							id:'1',
							text:'ChengDu',
							handler:btclc
						}));
						selectMenu.add(new Ext.Button({
							id:'7',
							text:'ChongQing',
							handler:btclc
						}));
					}
					selectMenu.show(this.el);
				}
			});
			
			var valipic = new Ext.form.FieldSet({
				layout:'column',
				items:[
					{
						xtype:'fieldset',
						width:'auto',
						height:130,
						columnWidth:.33,
						style:'padding:10 10',
						title:'contact',
						defaultType:'textfield',
						items:[
							{fieldLabel:'QQ',name:'qq'},
							{fieldLabel:'telephone',name:'telephone'}]
					},{
						xtype:'fieldset',
						width:'auto',
						height:130,
						style:'padding:10 10',
						columnWidth:.33,
						title:'hobby',
						defaultType:'textfield',
						items:[
							{fieldLabel:'interst1',name:'interst1'},
							{fieldLabel:'interst2',name:'interst2'},
							{fieldLabel:'interst3',name:'interst3'}]
					}
					,{
						xtype:'fieldset',
						width:'auto',
						height:130,
						style:'padding:10 10',
						columnWidth:.33,
						title:'validation',
						items:[
						{	
							xtype:'label',
							html:'<a href="#" onclick="refreshVC()"><img id="vcImage" src="GetValidationCodeServlet"/></a>'
						},
						{
							xtype:'textfield',
							name:'validationCode',
							fieldLabel:'Validation Code'
						}]
					}
				]
			})
			
			var form = new Ext.form.FormPanel({
				renderTo:'form',
				title:'form',
				width:850,
				height:600,
//				defaultType:'textfield',
				url:'show.jsp',
				frame:true,
				
				items:
				[
					{
						xtype:'fieldset',
						title:'personal',
						layout:'column',
						items:
						[
							{
								layout:'form',
								columnWidth:.33,
								items:[
									{xtype:'textfield',fieldLabel:'username',name:'username',allowBlank:false},
									{xtype:'textfield',fieldLabel:'password',allowBlank:false},
									{xtype:'textfield',fieldLabel:'password again',name:'password',allowBlank:false},
									{xtype:'textfield',fieldLabel:'email',name:'email',allowBlank:false}
								] 
							},
							{	
								layout:'form',
								columnWidth:.33,
								allowBlank:false,
								items:[bod]
							},
							{
								layout:'form',
								columnWidth:.33,
								items:[sexCombobox,btf]
							}
						]
					},
					valipic,hidCityId
				],
				buttons:
				[
					{text:'register!',handler:
							function(){
								form.getForm().getEl().dom.action='register.action';
								form.getForm().getEl().dom.submit();
//								form.getForm().submit({
//									waitMsg:'submiting...',
//									url:'show.jsp',
//									method : 'post',
//									success : function(form, action) {
//										form.getForm().reset();
//										alert(action.result.msg+'success');
//									},
//									failure : function(form, action) {
//										form.getForm().reset();
//										alert(action.result.msg+'fail');
//									}
//								});
							}
					},
					{text:'reset',handler:
							function(){
								form.getForm().reset();
							}
					}
				]
			})
		})
		var refreshVC = function(){
			var vcimg = document.getElementById("vcImage");
			vcimg.src = "GetValidationCode";
		}
		